package com.fxnotes.book.node;

import java.util.List;

public abstract class EditEntityHandler<T> {

    public boolean checkBeforeAdd(String name) {
        return true;
    }
    
    public abstract void onAdd(String name);

    public boolean checkBeforeUpdate(T entity, String name) {
        return true;
    }
    
    public abstract void onUpdate(T entity, String name);

    public boolean checkBeforeRemove(T entity, String name) {
        return true;
    }
    
    public abstract void onRemove(T entity);

    public void onSelectByClick(T entity) {
    }

    public void onSelectByDoubleClick(T entity) {
    }

    public void onChangePosition(List<T> entities, T changedEntity) {
    }
}
